
import sys
from PyQt4 import QtCore, QtGui

from Ui_principal import Ui_MainWindow

class MyForm(QtGui.QMainWindow):
    
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        x = 511
        self.ui.dial.setValue(270-(x/5.68))
    #senales
        QtCore.QObject.connect(self.ui.spinBox,QtCore.SIGNAL("valueChanged(int)"), self.cambiarAngulo)
        
    
    def cambiarAngulo(self):
        angulo = 270-self.ui.spinBox.value()
        self.ui.dial.setValue(angulo)
        self.ui.lcdAngulo.display(270-angulo)
        

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    myapp = MyForm()
    myapp.show()
    sys.exit(app.exec_())
    
